package com.cpit.qualitycontrol.entity;

import com.cpit.platform.common.excel.annotation.ExcelField;
import org.springframework.stereotype.Component;
import java.util.Date;


/**
 * 工单实体类 Created by fff on 2019/2/27.
 */

@Component

public class SubTaskReport {
    /**
     * 导出分组groups，工单类型导出不同的字段 ；
     *    group 1 基站勘察
     *    group 2 基站安装
     *    group 3 基站排障
     *    group 4 终端勘察
     *    group 5 终端安装
     *    group 6 终端排障
     *    group 7 监控勘察
     *    group 8 监控安装
     *    group 9 监控排障
     *
     *    0代表公共
     */

    /**
     * 设备ID
     */
    @ExcelField(title = "设备编号", type = 1, align = 1, sort = 1,groups = {0,1,2,3,4,5,6,7,8,9})
    private String deviceId;
    @ExcelField(title = "设备名称", type = 1, align = 1, sort = 1,groups = {0,1,2,3,4,5,6,7,8,9})
    private String deviceName;
    /**
     * 设备地址
     */
    @ExcelField(title = "设备地址", type = 1, align = 1, sort = 1,groups = {0,1,2,3,4,5,6,7,8,9})
    private String deviceAddrs;
//    @ExcelField(title = "工单类型", type = 1, align = 1, sort = 1)
//    private long  workOrderType;
    @ExcelField(title = "设备型号", type = 1, align = 1, sort = 1,groups = {0,1,2,3,4,5,6,7,8,9})
    private String version;
    @ExcelField(title = "设备类型", type = 1, align = 1, sort = 1,groups = {0,1,2,3,4,5,6,7,8,9})
    private String devicetype;
    @ExcelField(title = "工单类型", type = 1, align = 1, sort = 1, enums="{1='基站勘察',2='基站安装',3='基站排障',4='终端勘察',5='终端安装',6='终端排障',7='监控勘察',8='监控安装',9='监控排障'}",groups = {0,1,2,3,4,5,6,7,8,9})
    private Long additionalBusinessId;
    @ExcelField(title = "操作人", type = 1, align = 1, sort = 1,groups = {0,1,2,3,4,5,6,7,8,9})
    private  String operator;
    @ExcelField(title = "施工人", type = 1, align = 1, sort = 1,groups = {0,1,2,3,4,5,6,7,8,9})
    private String builder;
    /**
     * 施工公司名称，用逗号分隔
     */
    @ExcelField(title = "施工单位", type = 1, align = 1, sort = 1,groups = {0,1,2,3,4,5,6,7,8,9})
    private String constructionTeamNames;

    /**
     * 项目名称
     */
    @ExcelField(title = "项目名称", type = 1, align = 1, sort = 1,groups = {0,1,2,3,4,5,6,7,8,9})
    private String projectName;

    /**
     * 产品线名称
     */
    @ExcelField(title = "产品线名称", type = 1, align = 1, sort = 1,groups = {0,1,2,3,4,5,6,7,8,9})
      private String productLineName;

    /**
     * 状态 0-未派发，1-施工中，2-完成
     */
    @ExcelField(title = "状态", type = 1, align = 1, sort = 1,fieldType =Enum.class, enums="{0='未处理',1='未审核',2='已完成',3='待整改'}",groups = {0,1,2,3,4,5,6,7,8,9})
    private Integer state ;

    /**
     * 派单时间
     */
    @ExcelField(title = "派单时间", type = 1, align = 1, sort = 1,groups = {0,1,2,3,4,5,6,7,8,9})
    private Date assignTime;

    /**
     * 经度
     */
    @ExcelField(title = "经度", type = 0, align = 2, sort = 1, fieldType = String.class, decimalFormat = "#.#######",groups = {0,1,2,3,4,5,6,7,8,9})
    private Double longitude = 0.0;
    /**
     * 纬度
     */
    @ExcelField(title = "纬度", type = 0, align = 2, sort = 1, fieldType = String.class, decimalFormat = "#.#######",groups = {0,1,2,3,4,5,6,7,8,9})
    private Double latitude = 0.0;


    /**
     * 是否具备安装条件
     */
    @ExcelField(title = "具备安装", type = 1, align = 1, sort = 1, enums="{0='否',1='是'}",groups = {1,4,7})
    private Boolean install;


    /**
     * 不具备安装条件原因
     */
    @ExcelField(title = "原因", type = 1, align = 1, sort = 1,groups = {1,4,7})
    private String isInstallDesc;

    /**
     * 故障描述
     */
    @ExcelField(title = "故障描述", type = 1, align = 1, sort = 1,groups = {3,6,9})
    private String faultDesc;

    /**
     * 故障原因
     */
    @ExcelField(title = "故障原因", type = 1, align = 1, sort = 1,groups = {3,6,9})
    private String faultReason;

    /**
     * 是否恢复
     */
    @ExcelField(title = "是否恢复", type = 1, align = 1, sort = 1, enums="{0='否',1='是'}",groups = {3,6,9})
    private Boolean recove;

    /**
     * 采集方式 true-蓝牙 false-wifi
     */
    @ExcelField(title = "获取方式", type = 1, align = 1, sort = 1, enums="{0='WIFI',1='蓝牙'}",groups = {4,5})
    private Boolean acquisitionMode;

    /**
     * RSRP
     */
    @ExcelField(title = "RSRP", type = 1, align = 1, sort = 1,groups = {4,5})
    private Integer rsrp;
    /**
     * SINR
     */
    @ExcelField(title = "SINR", type = 1, align = 1, sort = 1,groups = {4,5})
    private Integer sinr;
    /**
     * CELLID
     */
    @ExcelField(title = "CELLID", type = 1, align = 1, sort = 1,groups = {4,5})
    private Integer cellid;


    /**
     * 完成时间
     */
    @ExcelField(title = "完成时间", type = 1, align = 1, sort = 1,groups = {0,1,2,3,4,5,6,7,8,9})
    private Date endTime;
    /**
     * 备注
     */
    @ExcelField(title = "备注", type = 1, align = 1, sort = 1,groups = {0,1,2,3,4,5,6,7,8,9})
    private String description;


    public SubTaskReport(String deviceId, String deviceName, String deviceAddrs, long additionalBusinessId, String version, String devicetype, String operator, String builder, Double longitude, Double latitude, String constructionTeamNames, String projectName, String productLineName,
                         Integer state, Date assignTime, Date endTime, String description ,Boolean isInstall, String isInstallDesc, String faultDesc,String faultReason,
                         Boolean isRecove, Boolean acquisitionMode, Integer rsrp, Integer sinr, Integer cellid) {
        this.deviceId = deviceId;
        this.deviceName = deviceName;
        this.deviceAddrs = deviceAddrs;
        this.operator = operator;
        this.builder = builder;
        this.version = version;
        this.devicetype = devicetype;
        this.additionalBusinessId = additionalBusinessId;
        this.longitude = longitude;
        this.latitude = latitude;
        this.constructionTeamNames = constructionTeamNames;
        this.projectName = projectName;
        this.productLineName = productLineName;
        this.state = state;
        this.assignTime = assignTime;
        this.endTime = endTime;
        this.description = description;


        this.install=isInstall;
        this.isInstallDesc=isInstallDesc;
        this.faultDesc= faultDesc;
        this.faultReason= faultReason;
        this.recove=isRecove;
        this.acquisitionMode=acquisitionMode;
        this.rsrp=  rsrp;
        this.cellid= cellid;
        this.sinr= sinr;

    }



    public String getBuilder() {
        return builder;
    }

    public void setBuilder(String builder) {
        this.builder = builder;
    }
/**
 * select st.device_id, dvc.name,  stbd.device_position, dvc.version, device_type.name,
 * process_rule.additional_business_id,   st.create_task_time  ,
 * stbd.latitude,stbd.longitude, st.organization_team_name,st.audit_count, project.name, st.sub_task_state ,
 * st.assign_task_time , st.end_task_time,st.description
 *  FROM  qc_sub_task as st, qc_sub_task_business_data as stbd ,device as dvc ,device_type, process_rule, work_order_type, qc_work_order,project,product_line

 #安装
 select st.device_id, dvc.name,  stbd.device_position, dvc.version, device_type.name, process_rule.additional_business_id,   st.create_task_time  ,
 stbd.latitude,stbd.longitude, st.organization_team_name,st.audit_count, project.name, st.sub_task_state ,
 st.assign_task_time , st.end_task_time,st.description
 FROM  qc_sub_task as st, qc_sub_task_business_data as stbd ,device as dvc ,device_type, process_rule, work_order_type, qc_work_order,project,product_line

 where st.work_order_id=stbd.work_order_id
 and  st.sub_task_id=stbd.sub_task_id
 and  st.device_id=dvc.id
 and dvc.device_type_id=device_type.id
 and work_order_type.id= process_rule.work_order_type_id
 and qc_work_order.work_order_id = st.work_order_id
 and dvc.project_id = project.id
 and  product_line.id=dvc.product_line_id ;


 #勘察
 select st.device_id, dvc.name,  stbd.device_position, dvc.version, device_type.name, process_rule.additional_business_id,   st.create_task_time  ,
 stbd.latitude,stbd.longitude, st.organization_team_name,st.audit_count, project.name, st.sub_task_state ,
 stbd.is_install, stbd.is_install_desc,st.assign_task_time , st.end_task_time,st.description
 FROM  qc_sub_task as st, qc_sub_task_business_data as stbd ,device as dvc ,device_type, process_rule, work_order_type, qc_work_order,project,product_line

 where st.work_order_id=stbd.work_order_id
 and  st.sub_task_id=stbd.sub_task_id
 and  st.device_id=dvc.id
 and dvc.device_type_id=device_type.id
 and work_order_type.id= process_rule.work_order_type_id
 and qc_work_order.work_order_id = st.work_order_id
 and dvc.project_id = project.id
 and  product_line.id=dvc.product_line_id ;


 #故障修复类
 select st.device_id, dvc.name,  stbd.device_position, dvc.version, device_type.name, process_rule.additional_business_id,   st.create_task_time  ,
 stbd.latitude,stbd.longitude, st.organization_team_name,st.audit_count, project.name, st.sub_task_state ,
 stbd.fault_desc, stbd.fault_reason, stbd.is_install_desc,st.assign_task_time , st.end_task_time,st.description
 FROM  qc_sub_task as st, qc_sub_task_business_data as stbd ,device as dvc ,device_type, process_rule, work_order_type, qc_work_order,project,product_line

 where st.work_order_id=stbd.work_order_id
 and  st.sub_task_id=stbd.sub_task_id
 and  st.device_id=dvc.id
 and dvc.device_type_id=device_type.id
 and work_order_type.id= process_rule.work_order_type_id
 and qc_work_order.work_order_id = st.work_order_id
 and dvc.project_id = project.id
 and  product_line.id=dvc.product_line_id ;









 */




    public String getOperator() {
        return operator;
    }

    public void setOperator(String operator) {
        this.operator = operator;
    }






    public String getDeviceId() {
        return deviceId;
    }

    public void setDeviceId(String deviceId) {
        this.deviceId = deviceId;
    }

    public String getDeviceName() {
        return deviceName;
    }

    public void setDeviceName(String deviceName) {
        this.deviceName = deviceName;
    }

    public String getDeviceAddrs() {
        return deviceAddrs;
    }

    public void setDeviceAddrs(String deviceAddrs) {
        this.deviceAddrs = deviceAddrs;
    }



    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public String getDevicetype() {
        return devicetype;
    }

    public void setDevicetype(String devicetype) {
        this.devicetype = devicetype;
    }



    public Double getLongitude() {
        return longitude;
    }

    public void setLongitude(Double longitude) {
        this.longitude = longitude;
    }

    public Double getLatitude() {
        return latitude;
    }

    public void setLatitude(Double latitude) {
        this.latitude = latitude;
    }

    public String getConstructionTeamNames() {
        return constructionTeamNames;
    }

    public void setConstructionTeamNames(String constructionTeamNames) {
        this.constructionTeamNames = constructionTeamNames;
    }

    public String getProjectName() {
        return projectName;
    }

    public void setProjectName(String projectName) {
        this.projectName = projectName;
    }

    public String getProductLineName() {
        return productLineName;
    }

    public void setProductLineName(String productLineName) {
        this.productLineName = productLineName;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public Date getAssignTime() {
        return assignTime;
    }

    public void setAssignTime(Date assignTime) {
        this.assignTime = assignTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Long getAdditionalBusinessId() {
        return additionalBusinessId;
    }

    public void setAdditionalBusinessId(Long additionalBusinessId) {
        this.additionalBusinessId = additionalBusinessId;
    }




    public Boolean getInstall() {
        return install;
    }

    public void setInstall(Boolean install) {
        install = install;
    }

    public String getIsInstallDesc() {
        return isInstallDesc;
    }

    public void setIsInstallDesc(String isInstallDesc) {
        this.isInstallDesc = isInstallDesc;
    }

    public String getFaultDesc() {
        return faultDesc;
    }

    public void setFaultDesc(String faultDesc) {
        this.faultDesc = faultDesc;
    }

    public Boolean getRecove() {
        return recove;
    }

    public void setRecove(Boolean recove) {
        recove = recove;
    }

    public String getFaultReason() {
        return faultReason;
    }

    public void setFaultReason(String faultReason) {
        this.faultReason = faultReason;
    }



    public Boolean getAcquisitionMode() {
        return acquisitionMode;
    }

    public void setAcquisitionMode(Boolean acquisitionMode) {
        this.acquisitionMode = acquisitionMode;
    }

    public Integer getRsrp() {
        return rsrp;
    }

    public void setRsrp(Integer rsrp) {
        this.rsrp = rsrp;
    }

    public Integer getCellid() {
        return cellid;
    }

    public void setCellid(Integer cellid) {
        this.cellid = cellid;
    }

    public Integer getSinr() {
        return sinr;
    }

    public void setSinr(Integer sinr) {
        this.sinr = sinr;
    }




    public SubTaskReport() {
    }

}